package com.cww.study.event;

import lombok.Data;


/**
 * @program: sbd
 * @description: 响应事件
 * @author: 陈英俊
 * @create: 2021-12-29 09:58
 */
@Data
public class Event {

    /**
     * 构建Controller监听器
     */
    private ControllerListener controllerListener;


    public void doControllerBefore(String requestUrl, String methodName, String args) {
        controllerListener.invokeControllerBefore(requestUrl, methodName, args);
    }

    public void doControllerAfter(Object obj) {
        controllerListener.invokeControllerAfter(obj);
    }


    /**
     * 构建异常监听器
     */
    private ExceptionListener exceptionListener;

    public void processException(Exception e) {
        this.exceptionListener.processException(e);
    }


    public Object responseException(Exception e) {
        return this.exceptionListener.responseException(e);
    }



}
